package com.ls.util.jdbcUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author 李朔
 * @version 1.0
 */
public class testUltis {
    public static void main(String[] args) throws SQLException {
        Connection connection=JDBCUtilsByDruid.getConnection();
        String sql="select userName from smbms_user";
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        ResultSet resultSet = preparedStatement.executeQuery();
        while(resultSet.next()){
            String userName = resultSet.getString("userName");
            System.out.println(userName);
        }

        //关闭连接
        JDBCUtilsByDruid.close(resultSet,preparedStatement,connection);

    }
}
